using System.Collections;
using System.Collections.Generic;
using UnityEngine;

/// <summary>
/// 火炬树桩攻击策略 - 被动技能，将经过的子弹转换为火焰子弹
/// 注意：实际的子弹转换逻辑在 Torchwood 类的 OnTriggerEnter2D 中实现
/// </summary>
public class TorchwoodAttackStrategy : AttackStrategyBase
{
    private TorchwoodSkillData m_TorchwoodSkillData;

    public TorchwoodAttackStrategy(SkillData data)
    {
        AttackData = data;
        if (data is TorchwoodSkillData torchwoodData)
        {
            m_TorchwoodSkillData = torchwoodData;
        }
    }

    public override void Execute(Entity target)
    {
        base.Execute(target);
        
        // Torchwood 是被动技能，不需要主动攻击
        // 子弹转换逻辑在 Torchwood 类的 OnTriggerEnter2D 中实现
        Logger.Log("TorchwoodAttackStrategy", $"Torchwood {Owner?.name} 已激活，等待子弹经过进行转换");
    }

    public override bool CheckCondition()
    {
        // Torchwood 只要存活就可以工作
        return Owner != null && Owner.HealthComponent != null && Owner.HealthComponent.CurHealth > 0;
    }
}

